using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
    public class ExpenseClaimInfo
    {
		#region Local Variable
		private String _Business;
		public String Business
		{
			get { return _Business; }
			set { _Business = value; }
		}
		private Int32 _Reference;
		public Int32 Reference
		{
			get { return _Reference; }
			set { _Reference = value; }
		}
		private String _ExcNo;
		public String ExcNo
		{
			get { return _ExcNo; }
			set { _ExcNo = value; }
		}
		private String _EmployeeName;
		public String EmployeeName
		{
			get { return _EmployeeName; }
			set { _EmployeeName = value; }
		}
		private String _SupportDoc;
		public String SupportDoc
		{
			get { return _SupportDoc; }
			set { _SupportDoc = value; }
		}
		private String _OurRef;
		public String OurRef
		{
			get { return _OurRef; }
			set { _OurRef = value; }
		}
		private DateTime _IssueDate;
		public DateTime IssueDate
		{
			get { return _IssueDate; }
			set { _IssueDate = value; }
		}
		private DateTime _ReceiptDate;
		public DateTime ReceiptDate
		{
			get { return _ReceiptDate; }
			set { _ReceiptDate = value; }
		}
		private Double _Amt;
		public Double Amt
		{
			get { return _Amt; }
			set { _Amt = value; }
		}
		private Double _OtherAmt;
		public Double OtherAmt
		{
			get { return _OtherAmt; }
			set { _OtherAmt = value; }
		}
		private String _Currency;
		public String Currency
		{
			get { return _Currency; }
			set { _Currency = value; }
		}
		private String _PymtRef;
		public String PymtRef
		{
			get { return _PymtRef; }
			set { _PymtRef = value; }
		}
		private DateTime _PaidDate;
		public DateTime PaidDate
		{
			get { return _PaidDate; }
			set { _PaidDate = value; }
		}
		private Int32 _PaymentTerm;
		public Int32 PaymentTerm
		{
			get { return _PaymentTerm; }
			set { _PaymentTerm = value; }
		}
		private DateTime _DueDate;
		public DateTime DueDate
		{
			get { return _DueDate; }
			set { _DueDate = value; }
		}
		private String _Description;
		public String Description
		{
			get { return _Description; }
			set { _Description = value; }
		}
		private DateTime _DeliveryDate;
		public DateTime DeliveryDate
		{
			get { return _DeliveryDate; }
			set { _DeliveryDate = value; }
		}
		private DateTime _ReturnedDate;
		public DateTime ReturnedDate
		{
			get { return _ReturnedDate; }
			set { _ReturnedDate = value; }
		}
		private String _Department;
		public String Department
		{
			get { return _Department; }
			set { _Department = value; }
		}
		private Int16 _Emailed;
		public Int16 Emailed
		{
			get { return _Emailed; }
			set { _Emailed = value; }
		}
		private String _Remark1;
		public String Remark1
		{
			get { return _Remark1; }
			set { _Remark1 = value; }
		}
		private String _Remark2;
		public String Remark2
		{
			get { return _Remark2; }
			set { _Remark2 = value; }
		}
		private String _Remark3;
		public String Remark3
		{
			get { return _Remark3; }
			set { _Remark3 = value; }
		}
		private Int32 _Mark;
		public Int32 Mark
		{
			get { return _Mark; }
			set { _Mark = value; }
		}
		private String _TransMitRef;
		public String TransMitRef
		{
			get { return _TransMitRef; }
			set { _TransMitRef = value; }
		}
		private DateTime _TransMitDate;
		public DateTime TransMitDate
		{
			get { return _TransMitDate; }
			set { _TransMitDate = value; }
		}
		private Int32 _MarkTrm;
		public Int32 MarkTrm
		{
			get { return _MarkTrm; }
			set { _MarkTrm = value; }
		}
		private String _TransMitStat;
		public String TransMitStat
		{
			get { return _TransMitStat; }
			set { _TransMitStat = value; }
		}
		private String _Receiver;
		public String Receiver
		{
			get { return _Receiver; }
			set { _Receiver = value; }
		}
		private String _EmployeeCode;
		public String EmployeeCode
		{
			get { return _EmployeeCode; }
			set { _EmployeeCode = value; }
		}
		private Double _PaidAmt;
		public Double PaidAmt
		{
			get { return _PaidAmt; }
			set { _PaidAmt = value; }
		}
		private Double _PaidOtherAmt;
		public Double PaidOtherAmt
		{
			get { return _PaidOtherAmt; }
			set { _PaidOtherAmt = value; }
		}
		private Int16 _Sent;
		public Int16 Sent
		{
			get { return _Sent; }
			set { _Sent = value; }
		}
		private String _CreatedBy;
		public String CreatedBy
		{
			get { return _CreatedBy; }
			set { _CreatedBy = value; }
		}
		private String _ModifiedBy;
		public String ModifiedBy
		{
			get { return _ModifiedBy; }
			set { _ModifiedBy = value; }
		}
		private DateTime _CreatedDate;
		public DateTime CreatedDate
		{
			get { return _CreatedDate; }
			set { _CreatedDate = value; }
		}
		private DateTime _ModifiedDate;
		public DateTime ModifiedDate
		{
			get { return _ModifiedDate; }
			set { _ModifiedDate = value; }
		}
        #endregion LocalVariable
        
        #region Constructor
		public ExpenseClaimInfo()
		{
			_Business = "";
			_Reference = -1;
			_ExcNo = "";
			_EmployeeName = "";
			_SupportDoc = "";
			_OurRef = "";
			_IssueDate = DateTime.Now;
			_ReceiptDate = DateTime.Now;
			_Amt = 0;
			_OtherAmt = 0;
			_Currency = "";
			_PymtRef = "";
			_PaidDate = DateTime.Now;
			_PaymentTerm = -1;
			_DueDate = DateTime.Now;
			_Description = "";
			_DeliveryDate = DateTime.Now;
			_ReturnedDate = DateTime.Now;
			_Department = "";
			_Emailed = (Int16)0;
			_Remark1 = "";
			_Remark2 = "";
			_Remark3 = "";
			_Mark = -1;
			_TransMitRef = "";
			_TransMitDate = DateTime.Now;
			_MarkTrm = -1;
			_TransMitStat = "";
			_Receiver = "";
			_EmployeeCode = "";
			_PaidAmt = 0;
			_PaidOtherAmt = 0;
			_Sent = (Int16)0;
			_CreatedBy = "";
			_ModifiedBy = "";
			_CreatedDate = DateTime.Now;
			_ModifiedDate = DateTime.Now;
		}
		public ExpenseClaimInfo(
			String Business,
			Int32 Reference,
			String ExcNo,
			String EmployeeName,
			String SupportDoc,
			String OurRef,
			DateTime IssueDate,
			DateTime ReceiptDate,
			Double Amt,
			Double OtherAmt,
			String Currency,
			String PymtRef,
			DateTime PaidDate,
			Int32 PaymentTerm,
			DateTime DueDate,
			String Description,
			DateTime DeliveryDate,
			DateTime ReturnedDate,
			String Department,
			Int16 Emailed,
			String Remark1,
			String Remark2,
			String Remark3,
			Int32 Mark,
			String TransMitRef,
			DateTime TransMitDate,
			Int32 MarkTrm,
			String TransMitStat,
			String Receiver,
			String EmployeeCode,
			Double PaidAmt,
			Double PaidOtherAmt,
			Int16 Sent,
			String CreatedBy,
			String ModifiedBy,
			DateTime CreatedDate,
			DateTime ModifiedDate
			)
		{
			_Business = Business;
			_Reference = Reference;
			_ExcNo = ExcNo;
			_EmployeeName = EmployeeName;
			_SupportDoc = SupportDoc;
			_OurRef = OurRef;
			_IssueDate = IssueDate;
			_ReceiptDate = ReceiptDate;
			_Amt = Amt;
			_OtherAmt = OtherAmt;
			_Currency = Currency;
			_PymtRef = PymtRef;
			_PaidDate = PaidDate;
			_PaymentTerm = PaymentTerm;
			_DueDate = DueDate;
			_Description = Description;
			_DeliveryDate = DeliveryDate;
			_ReturnedDate = ReturnedDate;
			_Department = Department;
			_Emailed = Emailed;
			_Remark1 = Remark1;
			_Remark2 = Remark2;
			_Remark3 = Remark3;
			_Mark = Mark;
			_TransMitRef = TransMitRef;
			_TransMitDate = TransMitDate;
			_MarkTrm = MarkTrm;
			_TransMitStat = TransMitStat;
			_Receiver = Receiver;
			_EmployeeCode = EmployeeCode;
			_PaidAmt = PaidAmt;
			_PaidOtherAmt = PaidOtherAmt;
			_Sent = Sent;
			_CreatedBy = CreatedBy;
			_ModifiedBy = ModifiedBy;
			_CreatedDate = CreatedDate;
			_ModifiedDate = ModifiedDate;
		}
		public ExpenseClaimInfo(DataRow dr)
		{
			if (dr != null)
			{
				_Business = dr["Business"] == DBNull.Value ? "" : (String)dr["Business"];
				_Reference = dr["Reference"] == DBNull.Value ? -1 : (Int32)dr["Reference"];
				_ExcNo = dr["ExcNo"] == DBNull.Value ? "" : (String)dr["ExcNo"];
				_EmployeeName = dr["EmployeeName"] == DBNull.Value ? "" : (String)dr["EmployeeName"];
				_SupportDoc = dr["SupportDoc"] == DBNull.Value ? "" : (String)dr["SupportDoc"];
				_OurRef = dr["OurRef"] == DBNull.Value ? "" : (String)dr["OurRef"];
				_IssueDate = dr["IssueDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["IssueDate"];
				_ReceiptDate = dr["ReceiptDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["ReceiptDate"];
				_Amt = dr["Amt"] == DBNull.Value ? 0 : (Double)dr["Amt"];
				_OtherAmt = dr["OtherAmt"] == DBNull.Value ? 0 : (Double)dr["OtherAmt"];
				_Currency = dr["Currency"] == DBNull.Value ? "" : (String)dr["Currency"];
				_PymtRef = dr["PymtRef"] == DBNull.Value ? "" : (String)dr["PymtRef"];
				_PaidDate = dr["PaidDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["PaidDate"];
				_PaymentTerm = dr["PaymentTerm"] == DBNull.Value ? -1 : (Int32)dr["PaymentTerm"];
				_DueDate = dr["DueDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["DueDate"];
				_Description = dr["Description"] == DBNull.Value ? "" : (String)dr["Description"];
				_DeliveryDate = dr["DeliveryDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["DeliveryDate"];
				_ReturnedDate = dr["ReturnedDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["ReturnedDate"];
				_Department = dr["Department"] == DBNull.Value ? "" : (String)dr["Department"];
				_Emailed = dr["Emailed"] == DBNull.Value ? (Int16)0 : (Int16)dr["Emailed"];
				_Remark1 = dr["Remark1"] == DBNull.Value ? "" : (String)dr["Remark1"];
				_Remark2 = dr["Remark2"] == DBNull.Value ? "" : (String)dr["Remark2"];
				_Remark3 = dr["Remark3"] == DBNull.Value ? "" : (String)dr["Remark3"];
				_Mark = dr["Mark"] == DBNull.Value ? -1 : (Int32)dr["Mark"];
				_TransMitRef = dr["TransMitRef"] == DBNull.Value ? "" : (String)dr["TransMitRef"];
				_TransMitDate = dr["TransMitDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["TransMitDate"];
				_MarkTrm = dr["MarkTrm"] == DBNull.Value ? -1 : (Int32)dr["MarkTrm"];
				_TransMitStat = dr["TransMitStat"] == DBNull.Value ? "" : (String)dr["TransMitStat"];
				_Receiver = dr["Receiver"] == DBNull.Value ? "" : (String)dr["Receiver"];
				_EmployeeCode = dr["EmployeeCode"] == DBNull.Value ? "" : (String)dr["EmployeeCode"];
				_PaidAmt = dr["PaidAmt"] == DBNull.Value ? 0 : (Double)dr["PaidAmt"];
				_PaidOtherAmt = dr["PaidOtherAmt"] == DBNull.Value ? 0 : (Double)dr["PaidOtherAmt"];
				_Sent = dr["Sent"] == DBNull.Value ? (Int16)0 : (Int16)dr["Sent"];
				_CreatedBy = dr["CreatedBy"] == DBNull.Value ? "" : (String)dr["CreatedBy"];
				_ModifiedBy = dr["ModifiedBy"] == DBNull.Value ? "" : (String)dr["ModifiedBy"];
				_CreatedDate = dr["CreatedDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["CreatedDate"];
				_ModifiedDate = dr["ModifiedDate"] == DBNull.Value ? DateTime.Now : (DateTime)dr["ModifiedDate"];
			}
		}
        public ExpenseClaimInfo(DataRowView dr)
        {
            if (dr != null)
            {
                _Business = dr["Business"] == DBNull.Value ? "" : (String)dr["Business"];
                _Reference = dr["Reference"] == DBNull.Value ? -1 : (Int32)dr["Reference"];
                _ExcNo = dr["ExcNo"] == DBNull.Value ? "" : (String)dr["ExcNo"];
                _EmployeeName = dr["EmployeeName"] == DBNull.Value ? "" : (String)dr["EmployeeName"];
                _SupportDoc = dr["SupportDoc"] == DBNull.Value ? "" : (String)dr["SupportDoc"];
                _OurRef = dr["OurRef"] == DBNull.Value ? "" : (String)dr["OurRef"];
                _IssueDate = dr["IssueDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["IssueDate"];
                _ReceiptDate = dr["ReceiptDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["ReceiptDate"];
                _Amt = dr["Amt"] == DBNull.Value ? 0 : (Double)dr["Amt"];
                _OtherAmt = dr["OtherAmt"] == DBNull.Value ? 0 : (Double)dr["OtherAmt"];
                _Currency = dr["Currency"] == DBNull.Value ? "" : (String)dr["Currency"];
                _PymtRef = dr["PymtRef"] == DBNull.Value ? "" : (String)dr["PymtRef"];
                _PaidDate = dr["PaidDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["PaidDate"];
                _PaymentTerm = dr["PaymentTerm"] == DBNull.Value ? -1 : (Int32)dr["PaymentTerm"];
                _DueDate = dr["DueDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["DueDate"];
                _Description = dr["Description"] == DBNull.Value ? "" : (String)dr["Description"];
                _DeliveryDate = dr["DeliveryDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["DeliveryDate"];
                _ReturnedDate = dr["ReturnedDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["ReturnedDate"];
                _Department = dr["Department"] == DBNull.Value ? "" : (String)dr["Department"];
                _Emailed = dr["Emailed"] == DBNull.Value ? (Int16)0 : (Int16)dr["Emailed"];
                _Remark1 = dr["Remark1"] == DBNull.Value ? "" : (String)dr["Remark1"];
                _Remark2 = dr["Remark2"] == DBNull.Value ? "" : (String)dr["Remark2"];
                _Remark3 = dr["Remark3"] == DBNull.Value ? "" : (String)dr["Remark3"];
                _Mark = dr["Mark"] == DBNull.Value ? -1 : (Int32)dr["Mark"];
                _TransMitRef = dr["TransMitRef"] == DBNull.Value ? "" : (String)dr["TransMitRef"];
                _TransMitDate = dr["TransMitDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["TransMitDate"];
                _MarkTrm = dr["MarkTrm"] == DBNull.Value ? -1 : (Int32)dr["MarkTrm"];
                _TransMitStat = dr["TransMitStat"] == DBNull.Value ? "" : (String)dr["TransMitStat"];
                _Receiver = dr["Receiver"] == DBNull.Value ? "" : (String)dr["Receiver"];
                _EmployeeCode = dr["EmployeeCode"] == DBNull.Value ? "" : (String)dr["EmployeeCode"];
                _PaidAmt = dr["PaidAmt"] == DBNull.Value ? 0 : (Double)dr["PaidAmt"];
                _PaidOtherAmt = dr["PaidOtherAmt"] == DBNull.Value ? 0 : (Double)dr["PaidOtherAmt"];
                _Sent = dr["Sent"] == DBNull.Value ? (Int16)0 : (Int16)dr["Sent"];
                _CreatedBy = dr["CreatedBy"] == DBNull.Value ? "" : (String)dr["CreatedBy"];
                _ModifiedBy = dr["ModifiedBy"] == DBNull.Value ? "" : (String)dr["ModifiedBy"];
                _CreatedDate = dr["CreatedDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["CreatedDate"];
                _ModifiedDate = dr["ModifiedDate"] == DBNull.Value ? DateTime.MinValue : (DateTime)dr["ModifiedDate"];
            }
        }
        #endregion Constructor
        
        #region InitTable
		public DataTable ToDataTable()
		{
			DataTable dt = new DataTable("TblExpenseClaim");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn("Business", typeof(String)),
				new DataColumn("Reference", typeof(Int32)),
				new DataColumn("ExcNo", typeof(String)),
				new DataColumn("EmployeeName", typeof(String)),
				new DataColumn("SupportDoc", typeof(String)),
				new DataColumn("OurRef", typeof(String)),
				new DataColumn("IssueDate", typeof(DateTime)),
				new DataColumn("ReceiptDate", typeof(DateTime)),
				new DataColumn("Amt", typeof(Double)),
				new DataColumn("OtherAmt", typeof(Double)),
				new DataColumn("Currency", typeof(String)),
				new DataColumn("PymtRef", typeof(String)),
				new DataColumn("PaidDate", typeof(DateTime)),
				new DataColumn("PaymentTerm", typeof(Int32)),
				new DataColumn("DueDate", typeof(DateTime)),
				new DataColumn("Description", typeof(String)),
				new DataColumn("DeliveryDate", typeof(DateTime)),
				new DataColumn("ReturnedDate", typeof(DateTime)),
				new DataColumn("Department", typeof(String)),
				new DataColumn("Emailed", typeof(Int16)),
				new DataColumn("Remark1", typeof(String)),
				new DataColumn("Remark2", typeof(String)),
				new DataColumn("Remark3", typeof(String)),
				new DataColumn("Mark", typeof(Int32)),
				new DataColumn("TransMitRef", typeof(String)),
				new DataColumn("TransMitDate", typeof(DateTime)),
				new DataColumn("MarkTrm", typeof(Int32)),
				new DataColumn("TransMitStat", typeof(String)),
				new DataColumn("Receiver", typeof(String)),
				new DataColumn("EmployeeCode", typeof(String)),
				new DataColumn("PaidAmt", typeof(Double)),
				new DataColumn("PaidOtherAmt", typeof(Double)),
				new DataColumn("Sent", typeof(Int16)),
				new DataColumn("CreatedBy", typeof(String)),
				new DataColumn("ModifiedBy", typeof(String)),
				new DataColumn("CreatedDate", typeof(DateTime)),
				new DataColumn("ModifiedDate", typeof(DateTime))
				});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row["Business"] = _Business;
			row["Reference"] = _Reference;
			row["ExcNo"] = _ExcNo;
			row["EmployeeName"] = _EmployeeName;
			row["SupportDoc"] = _SupportDoc;
			row["OurRef"] = _OurRef;
			row["IssueDate"] = _IssueDate;
			row["ReceiptDate"] = _ReceiptDate;
			row["Amt"] = _Amt;
			row["OtherAmt"] = _OtherAmt;
			row["Currency"] = _Currency;
			row["PymtRef"] = _PymtRef;
			row["PaidDate"] = _PaidDate;
			row["PaymentTerm"] = _PaymentTerm;
			row["DueDate"] = _DueDate;
			row["Description"] = _Description;
			row["DeliveryDate"] = _DeliveryDate;
			row["ReturnedDate"] = _ReturnedDate;
			row["Department"] = _Department;
			row["Emailed"] = _Emailed;
			row["Remark1"] = _Remark1;
			row["Remark2"] = _Remark2;
			row["Remark3"] = _Remark3;
			row["Mark"] = _Mark;
			row["TransMitRef"] = _TransMitRef;
			row["TransMitDate"] = _TransMitDate;
			row["MarkTrm"] = _MarkTrm;
			row["TransMitStat"] = _TransMitStat;
			row["Receiver"] = _Receiver;
			row["EmployeeCode"] = _EmployeeCode;
			row["PaidAmt"] = _PaidAmt;
			row["PaidOtherAmt"] = _PaidOtherAmt;
			row["Sent"] = _Sent;
			row["CreatedBy"] = _CreatedBy;
			row["ModifiedBy"] = _ModifiedBy;
			row["CreatedDate"] = _CreatedDate;
			row["ModifiedDate"] = _ModifiedDate;
			return row;
		}
        #endregion InitTable
    }
}
